@extends('layouts.admin')
@section('content')
    <div id="content-header">
        <h1>角色管理</h1>
        <div class="btn-group">
            <a class="btn btn-large tip-bottom" title="Manage Files"><i class="icon-file"></i></a>
            <a class="btn btn-large tip-bottom" title="Manage Users"><i class="icon-user"></i></a>
            <a class="btn btn-large tip-bottom" title="Manage Comments"><i class="icon-comment"></i><span class="label label-important">5</span></a>
            <a class="btn btn-large tip-bottom" title="Manage Orders"><i class="icon-shopping-cart"></i></a>
        </div>
    </div>
    <div id="breadcrumb">
        <a href="#" title="Go to Home" class="tip-bottom"><i class="icon-home"></i>角色列表</a>
        <a href="#" class="current">角色详情</a>
    </div>
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span12">
                <div class="widget-box">
                    <div class="widget-title">
								<span class="icon">
									<i class="icon-th"></i>
								</span>
                        <span class="label label-info"><a href="{{url('admin/user/useradd')}}" style="color:white">添加角色</a></span>
                    </div>
                    <div class="widget-content">
                        <form action="{{url('admin/riddle?page='.$page)}}" method="post" style="margin:0 auto">
                            {{csrf_field()}}
                            <table class="add_tab" style="margin:0 auto">
                                <tbody>
                                <tr>
                                    <th>用户名：</th>
                                    <td>
                                        <input type="hidden" name="id" value="{{$id}}">
                                        <input type="text" name="name" style="height:25px" value="{{$username}}" disabled="true">
                                    </td>
                                </tr>
                                <tr>
                                    <th>角色：</th>
                                    <td>
                                        @foreach($role as $r)
                                                <label><input type="checkbox" name="role_id[]" value="{{$r->id}}"  {{ in_array($r->id,$role_id)?'checked':'' }} style="margin-top:0px">{{$r->display_name}}</label>
                                        @endforeach
                                    </td>
                                </tr>
                                <tr>
                                    <th></th>
                                    <td>
                                        <input type="submit" value="提交">
                                        <input type="button" class="back" onclick="history.go(-1)" value="返回">
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </form>
                    </div>
                </div>

            </div>
        </div>
        <div class="row-fluid">
            <div id="footer" class="span12">
                2012 &copy; Unicorn Admin. Brought to you by <a href="https://wrapbootstrap.com/user/diablo9983">diablo9983</a>
            </div>
        </div>
    </div>
@endsection